package club.info.rest.repository;

import club.info.rest.pojo.Person;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RestResource;

import java.util.List;

@RestResource(path = "people")
public interface PersonRepository extends JpaRepository<Person, Integer> {

    @RestResource(path = "age")
    List<Person> findByAge(Integer age);

    @RestResource(path = "nameAndAddress", rel = "age?age=1")
    Person findByNameAndAddress(String name, String address);

}
